package com.alliky.home.ui.adapter;

import com.alliky.core.base.BaseAdapter;
import com.alliky.core.entity.vo.GoodsVO;
import com.alliky.core.util.ImageLoader;
import com.alliky.home.R;
import com.alliky.home.databinding.ItemHomeHotLayoutBinding;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * ================================================
 *
 * @Description: 描述
 * @Author: wxianing
 * @Date: 2023/6/1 17:52
 * ================================================
 */
public class HomeHotGoodsAdapter extends BaseAdapter<GoodsVO> {
    public HomeHotGoodsAdapter(@Nullable List<GoodsVO> data) {
        super(R.layout.item_home_hot_layout, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, GoodsVO goodsVO) {
        ItemHomeHotLayoutBinding binding = holder.getBinding();
        holder.setText(R.id.tv_name, goodsVO.getGoods_name());
        holder.setText(R.id.tv_price, "￥" + goodsVO.getMarket_price());
        ImageLoader.loadImage(getContext(),goodsVO.getGoods_thumb(),holder.getView(R.id.iv_thumb));
    }
}
